
<nav class="navbar fixed-top navbar-dark navbar-expand-xl">
    <div class="container">
        <a class="navbar-brand" href="/"><img src="/images/logo.png"></a>
        <button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar2">
            &#9776;
        </button>
        <div class="collapse navbar-collapse" id="exCollapsingNavbar2">

            <ul class="navbar-nav  ">
                <li class="nav-item"><a class="nav-link active" href="index.php">首页</a></li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="list.php"  data-toggle="dropdown">
                        全部产品
                    </a>
                    <div class="dropdown-menu">
                        <div style="max-width: 740px;">
                            <div class="row">
                                    <?php
                                    $conc=new Mysql();
                                    $sql="select id,title from newscata_product where CatalogParentId=0 order by SortId asc";
                                    $row1=$conc->getAll($sql);
                                    foreach($row1 as $k=>$rs){
                                        ?>
                                        <div class="col-4 mb-5">
                                            <a class="dropdown-item" href="list.php?type=<?php echo $rs["id"]?>"><strong><?php echo $rs["title"]?></strong></a>
                                            <?php
                                            $conc2=new Mysql();
                                            $sql2="select id,title from newscata_product where CatalogParentId=".$rs["id"]." order by SortId asc";
                                            $row2=$conc2->getAll($sql2);
                                            foreach($row2 as $k2=>$rs2) {
                                            ?>
                                                <a class="dropdown-item" href="list.php?type=<?php echo $rs2["id"]?>"><?=$rs2["title"]?></a>
                                                <?php
                                            }
                                            ?>

                                        </div>

                                        <?php

                                    }
                                    ?>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="nav-item"><a class="nav-link " href="istejia.php">限时特价</a></li>
                <li class="nav-item"><a class="nav-link " href="ishot.php">优选精品</a></li>
                <li class="nav-item"><a class="nav-link " href="tuan.php">团购</a></li>
                <li class="nav-item"><a class="nav-link " href="news.php?orderby=adate">最新资讯</a></li>
                <li class="nav-item"><a class="nav-link " href="contact.php?id=267">联系我们</a></li>
            </ul>
            <!--  -->
            <div class="fl-header-right ml-auto">
                <div class="collapse navbar-collapse">
                        <nav class="main_nav">

                            <ul>
                                <li><a class="cd-signin" href="#0">登录</a></li>
                                <li><a class="cd-signup" href="#0">注册</a></li>
                            </ul>

                        </nav>
                    <form class="navbar-form" role="search">
                        <div class="input-group">
                            <input class="GlobalNavSearch js-globalSearchInput " placeholder="搜索" id="desktopSearchInput" data-reactid=".1.0.0.0">
                            <label class="GlobalNavSearch-searchIcon" for="desktopSearchInput" data-reactid=".1.0.0.1"></label>
                        </div>
                    </form>
                </div>
            </div>
            <!--  -->
            <div class="btn-group dropdown-nav btn-shopping ml-3">
                <button type="button" class="btn btn-dark dropdown-toggle" data-offset="20px,20px">
                    &#9776;
                </button>
                <div class="dropdown-menu dropdown-menu-right">
                    <a class="dropdown-item" href="list.php">全部商品</a>
                    <a class="dropdown-item" href="istejia.php">限时特价</a>
                    <a class="dropdown-item" href="ishot.php">精选优品</a>
                    <a class="dropdown-item" href="tuan.php">团购</a>
                    <a class="dropdown-item" href="news.php">最新资讯</a>
                    <a class="dropdown-item" href="contact.php?id=267">关于众木森</a>
                </div>
            </div>
            <!--  -->
            <div class="btn-group dropdown-nav btn-company ml-3">
                <button type="button" class="btn btn-dark dropdown-toggle" data-offset="20px,20px">
                    &#9776;
                </button>
                <div class="dropdown-menu dropdown-menu-right">
                    <a class="dropdown-item" href="list.php">全部商品</a>
                    <a class="dropdown-item" href="istejia.php">限时特价</a>
                    <a class="dropdown-item" href="ishot.php">精选优品</a>
                    <a class="dropdown-item" href="tuan.php">团购</a>
                    <a class="dropdown-item" href="news.php">最新资讯</a>
                    <a class="dropdown-item" href="contact.php?id=267">关于众木森</a>
                </div>
            </div>
            <!--  -->
        </div>
        <!--  -->
</nav>


<link rel="stylesheet" type="text/css" href="static/login/css/style.css" />

<script type="text/javascript" src="static/login/js/jquery.min.js"></script>
<script type="text/javascript" src="static/login/js/main.js"></script>
<div class="cd-user-modal">
    <div class="cd-user-modal-container">
        <ul class="cd-switcher">
            <li><a href="#0">用户登录</a></li>
            <li><a href="#0">注册新用户</a></li>
        </ul>

        <div id="cd-login"> <!-- 登录表单 -->
            <form class="cd-form" >
                <p class="fieldset">
                    <label class="image-replace cd-username" for="signin-username">用户名</label>
                    <input class="full-width has-padding has-border" id="login-username" name="login-username" type="text" placeholder="输入用户名">
                </p>

                <p class="fieldset">
                    <label class="image-replace cd-password" for="signin-password">密码</label>
                    <input type="password" class="full-width has-padding has-border" id="login-password" name="login-password" type="text"  placeholder="输入密码">
                </p>

                <p class="fieldset">
                    <input type="checkbox" id="remember-me" checked>
                    <label for="remember-me">记住登录状态</label>
                </p>

                <p class="fieldset">
                    <input class="full-width2" id="clogin" name="clogin" type="submit" value="登 录">
                </p>
            </form>
        </div>

        <div id="cd-signup"> <!-- 注册表单 -->
            <form class="cd-form" method="post" action="signIn.php">
                <p class="fieldset">
                    <label class="image-replace cd-username" for="signup-username">用户名</label>
                    <input class="full-width has-padding has-border" id="signup-username" name="signup-username" type="text" placeholder="输入用户名">
                </p>

                <p class="fieldset">
                    <label class="image-replace cd-email" for="signup-email">邮箱</label>
                    <input class="full-width has-padding has-border" id="signup-email" name="signup-email" type="email" placeholder="输入mail">
                </p>

                <p class="fieldset">
                    <label class="image-replace cd-password" for="signup-password">密码</label>
                    <input type="password"  class="full-width has-padding has-border" id="signup-password" name="signup-password" type="text"  placeholder="输入密码">
                </p>

                <p class="fieldset">
                    <input type="checkbox" id="accept-terms">
                    <label for="accept-terms">我已阅读并同意 <a href="#0">用户协议</a></label>
                </p>

                <p class="fieldset">
                    <input class="full-width2" id="creg" name="creg" type="submit" value="注册新用户">
                </p>
            </form>
        </div>

        <a href="#0" class="cd-close-form">关闭</a>
    </div>
</div>
<script>
    $("#clogin").click(function(){
        var uname=$("#login-username").val();
        var upsw=$("#login-password").val();
        if(uname){
            if(upsw){
                $.ajax({
                    type:"POST",
                    url:"api/api.php",
                    data:{'mobile':uname,'psw':upsw,'act':'loginto'},
                    datatype: "json",
                    success:function(data){
                        if(data=="200"){
                                setTimeout(function ()
                                {
                                    window.location="user.php";
                                }, 1500)
                        }else{
                            alert("用户名密码不正确");
                        }


                    }
                });
                return false;
            }else{
                alert("密码不得为空");
                return false;
            }
        }else{
            alert("用户名不得为空");
            return false;
        }

    })
    $("#creg").click(function(){
        var uname2=$("#signup-username").val();
        var uemail2=$("#signup-email").val();
        var upsw2=$("#signup-password").val();
        if(uname2!=""){
            if(upsw2!=""){

                return true;
            }else{
                alert("密码不得为空");
                return false;
            }
        }else{
            alert("用户名不得为空2");
            return false;
        }
    })
</script>